Skip to content

test: add cross-platform build matrix#999

Open
cyphercodes wants to merge 4 commits intodapr:mainfrom
cyphercodes:cyphercodes/add-cross-platform-build-matrix
Open

test: add cross-platform build matrix#999
cyphercodes wants to merge 4 commits intodapr:mainfrom
cyphercodes:cyphercodes/add-cross-platform-build-matrix

Conversation

@cyphercodes
Copy link
Copy Markdown

Description

Adds Windows and macOS runners to the main build.yaml build/test job so PR and merge queue validation covers all supported platforms, not only Ubuntu. The unit-test job now uses an explicit tox environment from the matrix instead of a POSIX shell substitution, which keeps the step portable across GitHub-hosted Linux, Windows, and macOS runners. Typing remains Linux-only because it is platform-independent and the lint job already stays Linux-only.

Issue reference

Closes #998

Verification

  • Parsed .github/workflows/build.yaml with PyYAML and asserted the expected OS/Python tox matrix is present.
  • Ran actionlint .github/workflows/build.yaml.
  • Ran git diff --check.

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@cyphercodes cyphercodes requested review from a team as code owners April 29, 2026 18:21
Copy link
Copy Markdown
Contributor

@seherv seherv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this!

Dropping a link to #960 here so we can update this later to use uv.

Copy link
Copy Markdown
Contributor

@seherv seherv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, can you make it so it runs tests for all Python versions on Linux, and tests only 3.10 and 3.13 on Windows and Mac?

@cyphercodes
Copy link
Copy Markdown
Author

Updated the matrix per the review: Linux now runs 3.10, 3.11, 3.12, 3.13, and 3.14; Windows and macOS run only 3.10 and 3.13.

Verification run locally:

/tmp/actionlint/actionlint .github/workflows/build.yaml
git diff --check
python - <<'PY'
import yaml
from pathlib import Path
workflow = yaml.safe_load(Path('.github/workflows/build.yaml').read_text())
include = workflow['jobs']['build']['strategy']['matrix']['include']
actual = [(item['os'], item['python_version'], item['tox_env']) for item in include]
expected = [
    ('ubuntu-latest', '3.10', 'py310'),
    ('ubuntu-latest', '3.11', 'py311'),
    ('ubuntu-latest', '3.12', 'py312'),
    ('ubuntu-latest', '3.13', 'py313'),
    ('ubuntu-latest', '3.14', 'py314'),
    ('windows-latest', '3.10', 'py310'),
    ('windows-latest', '3.13', 'py313'),
    ('macos-latest', '3.10', 'py310'),
    ('macos-latest', '3.13', 'py313'),
]
if actual != expected:
    raise SystemExit(f'matrix mismatch: {actual!r}')
print('matrix OK:', actual)
PY

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.46%. Comparing base (bffb749) to head (232f8c4).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #999      +/-   ##
==========================================
- Coverage   86.63%   81.46%   -5.17%     
==========================================
  Files          84      139      +55     
  Lines        4473    13525    +9052     
==========================================
+ Hits         3875    11018    +7143     
- Misses        598     2507    +1909     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: cyphercodes <cyphercodes@users.noreply.github.com>
Signed-off-by: cyphercodes <cyphercodes@users.noreply.github.com>
Signed-off-by: cyphercodes <cyphercodes@users.noreply.github.com>
@cyphercodes cyphercodes force-pushed the cyphercodes/add-cross-platform-build-matrix branch from 2f034c3 to 2d13963 Compare April 30, 2026 14:17
@cyphercodes
Copy link
Copy Markdown
Author

Updated this PR after the Windows matrix exposed a cross-platform test assertion issue.

What changed:

  • Rebased the branch onto current dapr/python-sdk:main to clear the stale/behind Codecov comparison.
  • Made the sync/async test_wait_timeout assertions check for ConnectionRefusedError instead of the Linux-specific message text Connection refused, which does not appear in Windows' socket error text.

Local verification:

  • coverage run -m unittest discover -q ./tests ✅ (Ran 975 tests in 65.016s)
  • python -m unittest -v tests.clients.test_dapr_grpc_client.DaprGrpcClientTests.test_wait_timeout tests.clients.test_dapr_grpc_client_secure.DaprSecureGrpcClientTests.test_wait_timeout tests.clients.test_dapr_grpc_client_async.DaprGrpcClientAsyncTests.test_wait_timeout tests.clients.test_dapr_grpc_client_async_secure.DaprSecureGrpcClientAsyncTests.test_wait_timeout
  • ruff check tests/clients/test_dapr_grpc_client.py tests/clients/test_dapr_grpc_client_async.py
  • /tmp/actionlint/actionlint .github/workflows/build.yaml
  • git diff --check

The new GitHub Actions runs for commit 2d13963639cd8fe729e42477b4bbabd287ad4a56 are currently action_required, so they need maintainer approval before they can execute.

Signed-off-by: Rayan Salhab <7407177+cyphercodes@users.noreply.github.com>
@cyphercodes
Copy link
Copy Markdown
Author

Updated this PR to address the Windows failures from the latest CI run.

What changed:

  • The sync/async test_wait_timeout assertions now accept either ConnectionRefusedError or TimeoutError. The Windows runners were raising TimeoutError('timed out') for the same unused-port wait path, while Linux raises connection-refused.

Local verification:

  • python -m pip install -q -r dev-requirements.txt -e .
  • python -m unittest -v tests.clients.test_dapr_grpc_client.DaprGrpcClientTests.test_wait_timeout tests.clients.test_dapr_grpc_client_secure.DaprSecureGrpcClientTests.test_wait_timeout tests.clients.test_dapr_grpc_client_async.DaprGrpcClientAsyncTests.test_wait_timeout tests.clients.test_dapr_grpc_client_async_secure.DaprSecureGrpcClientAsyncTests.test_wait_timeout
  • ruff check tests/clients/test_dapr_grpc_client.py tests/clients/test_dapr_grpc_client_async.py
  • git diff --check

Note: the earlier validate (3.11) failure was in tests/examples/test_pubsub_streaming_async.py missing the final Closing subscription... output after Dapr shut down; that looks separate from this matrix/test assertion change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add Windows and macOS to CI test matrix

3 participants